﻿using MVC_No02.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MVC_No02.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        public ActionResult List()
        {
            List<Task> list;
            using (Model1 model = new Model1())
            {
                list = model.Task.Where(u => true).ToList();
            }
            return View(list);
        }

        public ActionResult Task()
        {
            List<Task> list;
            using (Model1 model = new Model1())
            {
                list = model.Task.Where(u => u.uid == 1).ToList();
            }
            return View(list);
        }
    }
}